package mapper;

import org.springframework.jdbc.core.RowMapper;
import pojo.User;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @Author: fancyears·milos·malvis
 * @Description:
 * @Date: Created in  2019/4/29 14:08
 * @Modified By:
 */
public class UserMapper implements RowMapper<User> {
    @Override
    public User mapRow(ResultSet resultSet, int i) throws SQLException {
        User user=new User();
        user.setId(resultSet.getLong("id"));
        user.setUsername(resultSet.getString("username"));
        return user;
    }
}
